package com.fire.control.system.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 
 * @ClassName:  Gateway
 * @Description:  网关信息
 * @author:  xiechengguang
 * @date:  2017年6月27日 下午8:47:07
 *
 */
@Entity
@Table(name = "t_gateway") 
public class Gateway extends BaseEntity {

	private static final long serialVersionUID = 1L;
	
	/**   
	 * @Fields address : 网关id
	 */ 
	@Column(name = "gateway_eui", nullable = false,length=50)
	private String gatewayEui;
	
	/**   
	 * @Fields address : 网关名称
	 */ 
	@Column(name = "gateway_name", nullable = false,length=50)
	private String gatewayName;
	
	/**   
	 * @Fields address : 地址
	 */ 
	@Column(name = "address", nullable = false,length=50)
	private String address;
	
	/**
	 * @Fields securityManager : 安全管理员
	 */
	@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.EAGER,optional=false)  
	@JoinColumn(name="manager_user_id")  
	private User securityManager;
	
	/**
	 * @Fields securityManager : 安全巡检员
	 */
	@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.EAGER,optional=false)  
	@JoinColumn(name="patrol_user_id")  
	private User securityPatrol;
	
	/**   
	 * @Fields company : 归属公司企业
	 */
	@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.EAGER,optional=false)  
	@JoinColumn(name="company_id")  
	private Company company;
	
	/**   
	 * @Fields location : 区域  
	 */ 
	@OneToOne(cascade={CascadeType.REFRESH},fetch=FetchType.EAGER,optional=false)  
	@JoinColumn(name="area_id")
	private Area area;
	
	@Column(name = "province_id")
	private String provinceId;//省
	
	@Column(name = "city_id")
	private String cityId;//市
	
	@ManyToOne(fetch=FetchType.LAZY,optional=false)
	@JoinColumn(name = "device_group_id")
	private DeviceGroup deviceGroup;

	public String getGatewayEui() {
		return gatewayEui;
	}

	public void setGatewayEui(String gatewayEui) {
		this.gatewayEui = gatewayEui;
	}

	public String getGatewayName() {
		return gatewayName;
	}

	public void setGatewayName(String gatewayName) {
		this.gatewayName = gatewayName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public User getSecurityManager() {
		return securityManager;
	}

	public void setSecurityManager(User securityManager) {
		this.securityManager = securityManager;
	}

	public User getSecurityPatrol() {
		return securityPatrol;
	}

	public void setSecurityPatrol(User securityPatrol) {
		this.securityPatrol = securityPatrol;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	public DeviceGroup getDeviceGroup() {
		return deviceGroup;
	}

	public void setDeviceGroup(DeviceGroup deviceGroup) {
		this.deviceGroup = deviceGroup;
	}

	public String getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}

	public String getCityId() {
		return cityId;
	}

	public void setCityId(String cityId) {
		this.cityId = cityId;
	}
	
	
	
}
